<?php
/** 
 * 
 * @author Mark Wilson
 * @name Generator.class.php
 */
class Generator {
	
	public static function generateCodes($qty=1,$len=4,$skip=array()) {
		$chars = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
		$ret = array();
		for($i=0; $i<$qty;$i++){
			do {
				$rand = str_shuffle($chars);
			} while( in_array($rand,$skip));
			$code = substr($rand,0,$len);
			$ret[] = $code;
			$skip[] = $code; // add to skiplist
		}
		return count($ret)>1?$ret:$ret[0];
	}
	
	private function _generateXML() {
		
	}
	
	
}
